package com.example.constellation.utils;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;

public class URLContent {
    //星座配对接口  从聚合数据接口 获取星座配对数据  https://www.juhe.cn
    //http://apis.juhe.cn/xzpd/query?men=%E9%87%91%E7%89%9B&women=%E7%99%BD%E7%BE%8A&key=d343fa68059e2766d4c39bc8742f565c
    public static String getPartnerUrl(String men,String woman)
    {
        men=men.replace("座","");
        woman=woman.replace("座","");
        try {
            URLEncoder.encode(men,"UTF-8");
            URLEncoder.encode(woman,"UTF-8");
        } catch (Exception e) {
            e.printStackTrace();
        }
        String url="http://apis.juhe.cn/xzpd/query?men="+men+"&women="+woman+"&key=d343fa68059e2766d4c39bc8742f565c";
        return url;

    }


    //星座运势接口
    public static String getLuckURL(String name)
    {
        try {
            name = URLEncoder.encode(name, "UTF-8");
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        String url="http://web.juhe.cn/constellation/getAll?consName="+name+"&type=year&key=1b13c563f281338119f0d6ae8aca1e4c";
        return url;

    }

}
